#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
int main(int argc,const char*argv[])
{
	int p=-1;
	if((p=open(argv[1],O_RDONLY))==-1){perror("打开失败");return -1;}
	char x[128];
	while(1)
	{
		bzero(x,128);
		read(p,x,128);
		printf("%s\n",x);
		if(strcmp(x,"q")==0)
			break;
	}
	close(p);
	return 0;
}
